const routes = [
  // 合作商
  {
    name: "franchisee",
    path: "/franchisee/list",
    component: "/franchisee/list"
  },
  {
    name: "franchiseeDetail",
    path: "/franchisee/list/detail",
    component: "/franchisee/detail",
    hideInMenu: true
  },
  {
    name: "franchiseeAdd",
    path: "/franchisee/list/add",
    component: "/franchisee/add",
    hideInMenu: true
  },
  {
    name: "franchiseeEdit",
    path: "/franchisee/list/edit",
    component: "/franchisee/add",
    hideInMenu: true
  },
  {
    name: "franchiseePush",
    path: "/franchisee/list/push/:fid",
    component: "/franchisee/push",
    hideInMenu: true
  },
  // 驿站合同
  {
    name: "posthouseContract",
    path: "/posthouseContract/list",
    component: "/posthouseContract/list"
  },
  {
    name: "contractDetail",
    path: "/posthouseContract/list/detail/:pid",
    component: "/posthouseContract/detail",
    hideInMenu: true
  },
  {
    name: "posthouseContractAdd",
    path: "/posthouseContract/list/add",
    component: "/posthouseContract/add",
    hideInMenu: true
  },
  {
    name: "posthouseContractEdit",
    path: "/posthouseContract/list/edit/:pid",
    component: "/posthouseContract/add",
    hideInMenu: true
  },
  // 合作商合同
  {
    name: "franchiseeContract",
    path: "/franchiseeContract/list",
    component: "/franchiseeContract/list"
  },
  {
    name: "contractDetail",
    path: "/franchiseeContract/list/detail",
    component: "/franchiseeContract/detail",
    hideInMenu: true
  },
  {
    name: "contractAdd",
    path: "/franchiseeContract/list/add/",
    component: "/franchiseeContract/add",
    hideInMenu: true
  },
  {
    name: "contractEditor",
    path: "/franchiseeContract/list/editor/",
    component: "/franchiseeContract/add",
    hideInMenu: true
  },
  // 提现权限
  {
    name: "withdrawalPermission",
    path: "/withdrawalPermission/list",
    component: "/withdrawalPermission/list"
  },
  // 合作商充值
  {
    name: "rechargeMoneyList",
    path: "/rechargeMoney/list",
    component: "/rechargeMoney/list"
  },
  {
    name: "rechargeMoneyRecords",
    path: "/rechargeMoney/list/records",
    component: "/rechargeMoney/chargeRecords",
    hideInMenu: true
  },
  {
    name: "rechargeMoneyConsumption",
    path: "/rechargeMoney/list/consumption",
    component: "/rechargeMoney/consumptionRecords",
    hideInMenu: true
  },
  {
    name: "rechargeMoneyDetail",
    path: "/rechargeMoney/list/detail",
    component: "/rechargeMoney/rechargeDetail",
    hideInMenu: true
  },
  // 合作商提现
  {
    name: "withdrawalMoneyList",
    path: "/withdrawalMoney/list",
    component: "/withdrawalMoney/list"
  },
  {
    name: "withdrawalMoneyRecords",
    path: "/withdrawalMoney/list/records",
    component: "/withdrawalMoney/withdrawalRecords",
    hideInMenu: true
  },
  {
    name: "withdrawalMoneyBooked",
    path: "/withdrawalMoney/list/booked",
    component: "/withdrawalMoney/bookedRecords",
    hideInMenu: true
  },
  {
    name: "withdrawalMoneyDetail",
    path: "/withdrawalMoney/list/detail",
    component: "/withdrawalMoney/withdrawalDetail",
    hideInMenu: true
  },
  // 合作商结算单管理
  {
    name: "partnersStatementsList",
    path: "/partnersStatements/list",
    component: "/partnersStatements/list"
  },
  {
    name: "partnersStatementsDetail",
    path: "/partnersStatements/list/detail",
    component: "/partnersStatements/statementsDetail",
    hideInMenu: true
  },
]

const partner = routes.map((route: any) => {
  route.path = `/partner${route.path}`;
  route.component = `./partner${route.component}`;
  return route;
}, {});

export default [
  {
    name: "partner",
    path: "/partner",
    icon: "smile",
    routes: [
      ...partner,
      {
        component: "./404"
      }
    ]
  },
];
